<!doctype html>
<!--[if lt IE 7]>
<html lang="en" class="no-js ie6"><![endif]-->
<!--[if IE 7]>
<html lang="en" class="no-js ie7"><![endif]-->
<!--[if IE 8]>
<html lang="en" class="no-js ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org">
<!--<![endif]-->

<head>
    <meta charset="UTF-8">
    <title>随寻通教育信息品台 快捷高效的沟通桥梁 | 随寻通教育信息平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <link rel="shortcut icon" th:href="@{/favicon.png}">

    <link rel="stylesheet" th:href="@{/css/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/css/animate.css}">
    <link rel="stylesheet" th:href="@{/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{/css/slick.css}">
    <link rel="stylesheet" th:href="@{/js/rs-plugin/css/settings.css}">
    <link rel="stylesheet" th:href="@{/css/caseShow.css}">
    <script type="text/javascript" th:src="@{/js/modernizr.custom.32033.js}"></script>

    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<div th:include="template :: header"></div>
<div class="case-show">
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            <li data-target="#carousel-example-generic" th:each="banner,bannerStat : ${bannerList}"
                th:attr="data-slide-to=${bannerStat.index}" th:class="${bannerStat.index == 0 ? 'active': ''}"></li>
        </ol>

        <!-- Wrapper for slides -->
        <div class="carousel-inner" role="listbox" th:if="${bannerList != null}">
            <div th:each="banner,bannerStat : ${bannerList}"
                 th:class="'item '+ ${bannerStat.index == 0 ? 'active': ''}">
                <img th:src="${banner.imgUrl}" alt="..." style="display: block;width:100%">
            </div>
        </div>

        <!-- Controls -->
        <a class="left carousel-control" href="#" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>

    <div class="wrapper container-fluid">
        <section id="agreement">
            <div class="container">

                <div class="center">
                    <h1>合作政策</h1>
                    <div class="divider"></div>
                    <p>Co-operation Agreement</p>
                </div>

                <div class="policy-content row">
                    <div class="col-lg-10 col-md-10 col-md-offset-1 col-lg-offset-1">
                        <div class="row">
                            <div th:if="${policyPage != null and not #lists.isEmpty(policyPage.list) }">
                                <div class="col-lg-4 col-md-4 single-policy" th:each="policy : ${policyPage.list}">
                                    <div class="box">
                                        <h3 th:text="${policy.title}">Cardio Monitoring</h3>
                                        <p th:text="${policy.introduce}">There are many variations of passages of Lorem
                                            Ipsum available, but the majority
                                            have
                                            suffered alteration in some form, by injected humour</p>
                                    </div>
                                    <a th:href="'/ecosphere/getPolicy/' + ${policy.id}" class="view-btn">详情</a>
                                </div>
                            </div>
                        </div>
                        <div class="wp-page"></div>
                    </div>
                </div>
            </div>
        </section>
        <section id="schools">
            <div class="container">

                <div class="center">
                    <h1>合作伙伴</h1>
                    <div class="divider"></div>
                    <p>Co-operation Schools</p>
                </div>

                <div class="partner-content row">
                    <div class="col-lg-10 col-md-10 col-md-offset-1 col-lg-offset-1">
                        <div class="row">
                            <div th:if="${partnerPage != null and not #lists.isEmpty(partnerPage.list) }">
                                <div class="col-lg-3 col-md-3 " th:each="partner : ${partnerPage.list}">
                                    <div class="single-partner">
                                        <img th:src="${partner.imgUrl}">
                                        <a th:href="'/ecosphere/getPartner/' + ${partner.id}" class="detail">查看详情</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="wp-page"></div>
            </div>
        </section>

    </div>

    <div th:include="template :: footer"></div>

</div>

<script th:src="@{/js/jquery-1.11.1.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/slick.min.js}"></script>
<script th:src="@{/js/placeholdem.min.js}"></script>
<script th:src="@{/js/rs-plugin/js/jquery.themepunch.plugins.min.js}"></script>
<script th:src="@{/js/rs-plugin/js/jquery.themepunch.revolution.min.js}"></script>
<script th:src="@{/js/waypoints.min.js}"></script>
<script th:src="@{/js/caseShow.js}"></script>
<style>
    .wp-page *{
        padding:0 10px;
        margin: 0 10px;
    }
</style>

<script th:inline="javascript">
    $(document).ready(function () {
        appMaster.preLoader();
    });


    //分页操作
    var page1Total = [[${policyPage.pages}]];
    var page1Num=[[${policyPage.pageNum}]];
    var page1Size=6;
    var page2Total = [[${partnerPage.pages}]];
    var page2Num=[[${partnerPage.pageNum}]];
    var page2Size=8;
    console.log(page2Num)
    $('.wp-page:eq(0)').html(pageDeal(page1Num,page1Total,0))
    $('.wp-page:eq(1)').html(pageDeal(page2Num,page2Total,1))

    function pageDeal(pageNum,pageTotal,sign) {
        var pageHtml = '<span class="pages">Page '+pageNum+' of ' + pageTotal + '</span>';
        var url=''
        if(pageNum!=1){
            url='/ecosphere/index/1/'+page1Size+'/'+page2Num+'/'+page2Size;
            if(sign==1)
                url='/ecosphere/index/'+page1Num+'/'+page1Size+'/1/'+page2Size;

            pageHtml+='<a class="page" href="'+url+'">1</a>';
        }


        if(pageNum>2){
            url='/ecosphere/index/'+(pageNum-1)+'/'+page1Size+'/'+page2Num+'/'+page2Size;
            if(sign==1)
                url='/ecosphere/index/'+page1Num+'/'+page1Size+'/'+(pageNum-1)+'/'+page2Size;

            pageHtml+='<a class="page" href="'+url+'">'+(pageNum-1)+'</a>';
        }

        pageHtml+='<span class="current"><span>'+pageNum+'</span></span>';

        if(pageNum<pageTotal-1){
            url='/ecosphere/index/'+(pageNum+1)+'/'+page1Size+'/'+page2Num+'/'+page2Size;
            if(sign==1)
                url='/ecosphere/index/'+page1Num+'/'+page1Size+'/'+(pageNum+1)+'/'+page2Size;

            pageHtml+='<a class="page" href="'+url+'">'+(pageNum+1)+'</a>';
        }


        if(pageNum!=pageTotal){
            url='/ecosphere/index/'+pageTotal+'/'+page1Size+'/'+page2Num+'/'+page2Size;
            if(sign==1)
                url='/ecosphere/index/'+page1Num+'/'+page1Size+'/'+pageTotal+'/'+page2Size;

            pageHtml+='<a class="page" href="'+url+'">'+pageTotal+'</a>';
        }
        return pageHtml;
    }


</script>

</body>

</html>
